<?php

require_once './application/controllers/ControllerBase.php';
require_once './application/core/CoreBase.php';
require_once './application/core/Config/indexCore.php';
require_once './application/core/Config/diffCore.php';
require_once './application/core/Config/listConfig.php';
require_once './application/core/Config/listdiffConfig.php';
require_once './application/core/Config/backupCore.php';
require_once './application/core/Config/restoreCore.php';

class ConfigController extends ControllerBase
{

    function indexAction()
    {
        $this->verifConnexion();
        $this->renderTabControl();
        $core = new IndexCore($this);
        $core->Execute();
    }

    //Function pour le service backup perl
    function backupAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new backupCore($this);
        $t->backup();
    }

    //Reponse service backup
    function backuprespAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new backupCore($this);
        $t->backupResp();
    }

    function checkbackuprespAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new backupCore($this);
        $t->checkBackupResp();
    }

    //Function pour le service restore perl
    function restoreAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new restoreCore($this);
        $t->restore();
    }

    //Function pour le service reponse de restore perl
    function restorerespAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new restoreCore($this);
        $t->restoreResp();
    }

    //Recupere la liste des configuration
    function getlistconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new listConfig($this);
        $t->getListConfig();
    }

    function cleansessionAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new listdiffConfig($this);
        $t->cleanSessionBackup();
    }

    function getlistconfallAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new listConfig($this);
        $t->getListConfigAll();
    }

    //Recupere la liste des configuration pour le tree
    function getlistdiffconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new listdiffConfig($this);
        $t->getListAllConf();
    }

    function printdiffconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new diffCore($this);
        $t->getDiffConf();
    }

    function getconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new listConfig($this);
        $t->getConfig();
    }

    function deleteconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new diffCore($this);
        $t->deleteConf();
    }

    function diffconfAction()
    {
        $this->verifConnexion();
        $this->noRender();
        $t = new diffCore($this);
        $t->diffConf();
    }

}